let form = layui.form;

form.verify({
    len: [/^\S{6,12}$/, '长度6~12位不能有空格'],
    diff: function (val) {
        if (val == $('.oldPwd').val()) return '新密码不能和原密码一样';
    },
    same: function (val) {
        if (val != $('.newPwd').val()) return '两次密码输入不一致';
    }
})